<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    h2 {
        text-align: center;
    }
    table{
        border-collapse:collapse;
        height: 80px;
        margin: 0 auto;
        text-align: center;
    }
    th{
        padding:5px 30px;
    }
    table,th,td{
        border: 1px solid  #000;
    }
</style>
<body>
    <h2>订单确认</h2>
    
    <script>
        // 1.用户输入
        let price = +prompt('请输入商品价格：')
        let num = +prompt('请输入商品数量：')
        let uname = prompt('请输入收件人姓名：')
        let address = prompt('请输入收件地址：')
        //2.计算商品总价
        let total = price * num
        //3.页面渲染打印
        document.write(`
            <table>
                <tr>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品数量</th>
                <th>收件地址</th>
                <th>收件人姓名</th>
                </tr>
                <tr>
                    <td>兰博基尼</td>
                    <td>${price}</td>
                    <td>${2}</td>
                    <td>${address}</td>
                    <td>${uname}</td>
                </tr>
            </table>
        `)
    </script>
</body>
</html>